#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ans;
  cin >> n >> ans;
  ans = abs(ans);
  for (int i = 0; i < n - 1; ++i) {
    int x;
    cin >> x;
    x = abs(x);
    ans = __gcd(x, ans);
  }
  cout << ans << endl;
}
